﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Delegate
{
    public delegate void TemperatureEventHandler(int param);
    class Heater
    {
        public event TemperatureEventHandler Temperature;
        private int temperature;
        public void BuildHeater()
        {
            for (int i = 0; i < 100; i++)
            {
                temperature = i;
                if (i>95)
                {
                    var handler = Temperature;
                    if (handler != null)
                        handler(i);
                }
            }
        }
    }
}
